export interface CancelButtonProps {
    text?: string,
    type?: string,
    danger?: boolean,
    size?: 'large' | 'middle' | 'small'
}
export interface ConfrimButtonProps {
    text?: string,
    type?: string,
    danger?: boolean,
    size?: 'large' | 'middle' | 'small',
    icon?: VNode,
}

export interface PopupProps {
    type?: 'Drawer' | 'Modal'; // 弹出层类型
    open?: boolean,
    width?: number | string,
    loading?: boolean,
    styleType?: String,
    confrimButton?: Fn,
    cancelButton?: Fn,
    confrimButtonProps?: ConfrimButtonProps,
    cancelButtonProps?: CancelButtonProps,
    [x: string]: any; // 其他参数
}

export interface PopupAction {
   openPopup: () => Promise<void>;
   closePopup: () => Promise<void>;
   openPopupLoading: () => Promise<void>;
   closePopupLoading: () => Promise<void>;
   setProps: (formProps: Partial<PopupProps>) => Promise<void>;
   loading?: boolean;
}

export type RegisterFn = (formInstance: PopupAction) => void;

export type UsePopupReturnType = [RegisterFn, PopupAction];

export interface ParamMeter { [key:string]: any };

  